<?php
namespace Wap\Controller;
use Think\Controller;
use Think\Log;
class WXPAY{
	const MODULE_SHOP = 1001;
}

class WxpayController extends Controller {
	//获取支付配置
	private function getConfig($token){
	
		$set = M('pay_config')->where(array('token'=>$token))->field('wxpay_config')->find();
		$set['config'] = unserialize($set['wxpay_config']);
		return array('APPID'=>$set['config']['appid'],'MCHID'=>$set['config']['mchid'],'KEY'=>$set['config']['key']);
	}

	/*乐富支付*/
	public function index()
	{

	    $tjurl = "http://www.lefusdk.com/pay.php";
	    $para['cpid'] = '1036';
	    $para['appid'] = '6036';
	    $para['user_id'] = $_SESSION['user_id'];
	    $para['cp_trade_no'] = $_GET['out_trade_no'];
	    $para['fee'] = $_GET['price'] * 100;  /*金额，以分为单位*/
	    $para['jump_url'] = C('WAP_DOMAIN').'/wap/wxpay/jump/';   /*待定*/
	    $para['notify_url'] = C('WAP_DOMAIN').'/wap/wxpay/notify/';

	    $para['w_type'] = 1;
        $isweixin = is_weixin();
        if( $isweixin == true )
        {
            $para['w_type'] = 1;
        }else{
            $para['w_type'] = 2;
        }

//        $string = "";
//        foreach( $para as $key=>$val )
//        {
//            $string = $key."=".$val."&";
//        }
//        $string = substr( $string, 0,strlen( $string ) - 1 );
//
//
//        $ch = curl_init( $tjurl."?".$string );
//        curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
//        curl_setopt( $ch, CURLOPT_HEADER,1 );
//        $output = curl_exec( $ch );
//        curl_close( $ch );
//        echo $output;
//	    @header("Location:$stringurl");
//        exit();
//



        $def_url  = '<br /><form id="Form1" name="Form1" style="text-align:center;" method="get" action="'.$tjurl.'" target="_self">';
        foreach ($para as $key => $val) {
            $def_url = $def_url . '<input type="hidden" name="' . $key . '" value="' . $val . '" />';
//            $def_url = $def_url . '<input type="text" name="' . $key . '" value="' . $val . '" />';
        }

        $def_url .= '<input style="visibility:hidden" id="subbtn" type="submit" value="继续支付" />';
//        $def_url .= '<input style="display:block" id="subbtn" type="submit" value="继续支付" />';
        $def_url .= '</form>';
        $this->assign('callback',$def_url);
        $this->display();
	}

    /*全民金服*/
    public function indexquanminjinfu(){
        $appkey = "6413f866b558d3e2b6ccf4f0d865f9df";
        $keyvalue = "u4smNesRMrDAIU62HXNy1eoeP9uD8yaUKCcd103j";
        $tjurl = "https://testpayapi.aijinfu.cn/pay/multifunctionPayment.do";

        $parray = array();
        $parray['appKey'] = $appkey;
        $parray['bussOrderNum'] = $_GET['out_trade_no'];
        $parray['orderName'] = "MicroTransaction";
        $parray['notifyUrl'] = C('WAP_DOMAIN').'/wap/wxpay/notifyqmjf/';
        $parray['returnUrl'] = C('WAP_DOMAIN');
        $parray['ip'] = getClientIP();
        $parray['payMoney'] = $_GET['price'];

        $tmp = get_device_type();

        if( $tmp == "android" )
        {
            $parray['appType'] = 1;
        }else if( $tmp == "ios" )
        {
            $parray['appType'] = 2;
        }
        /*微信公众号*/
//        $isweixin = is_weixin();
//        if( $isweixin == true )
//        {
//            $parray['payPlatform'] = 2;
//        }
        $parray['payPlatform'] = 2;


        ksort( $parray );
        $stringA = "";
        foreach( $parray as $key=>$value )
        {
            if( $value != null || $value != "" )
            $stringA = $stringA."&".$key."=".urlencode($value);
        }
        $stringA = $keyvalue.$stringA;
        $sign = md5(strtoupper($stringA));
        $parray['sign'] = $sign;


        $stringB = "";
        foreach( $parray as $key=>$value )
        {
            if( $value != null || $value != "" )
            $stringB = $stringB."&".$key."=".urlencode($value);
        }

        $stringB = substr( $stringB, 1, strlen( $stringB ) );


        $def_url  = '<br /><form id="Form1" style="text-align:center;" method="get" action="'.$tjurl.'" target="_blank">';
//        foreach ($para as $key => $val) {
//            $def_url = $def_url . '<input type="text" name="' . $key . '" value="' . $val . '" />';
//        }
//
        $def_url = $def_url . '<input type="text" name="paramStr" value="' . $stringB . '" />';

        $def_url .= '<input style="display:none" type="submit" value="继续支付" />';
        $def_url .= '</form>';
        $this->assign('callback',$def_url);
        $this->display();




    }

    /*
    通付宝
    */
	public function index2()
    {
         /*curl*/
         $paytype = "WW";
         $merid = "0010201708110170";
         $secretkey = "589d3acaa63049ec9689da25b0722e69";
         $para['merId'] = $merid;
         $para['attach'] = time();
         $para['merNo'] = $_GET['out_trade_no'];
         $para['title'] = 'tradeplatformcharge';
         $para['describe'] = 'tradeplatformcharge';
         $para['payType'] = $paytype;   /*待定*/
         $para['price'] = $_GET['price'];
         $para['notifyUrl'] = C('WAP_DOMAIN').'/wap/wxpay/notify/';
         $para['synUrl'] = C('WAP_DOMAIN').'/wap/wxpay/synurl/';
         ksort( $para );
         $stringA = "";
         foreach( $para as $key=>$value )
         {
             if( $value != null || $value != "" )
             $stringA = $stringA.$key."=".urlencode($value)."&";
         }


//           $signTmp = $stringA."&&589d3acaa63049ec9689da25b0722e69";
           $signTmp = substr( $stringA, 0, strlen($stringA)-1 );

//           echo "<br/>".$signTmp."<br/>";

           $signTmp = $signTmp."&&&".$secretkey;

//            echo "<br/>".$signTmp."<br/>";
         $sign = md5( $signTmp );


         $ch = curl_init( "http://www.flksj2013.cn/allpay/payorder" );
         curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
         curl_setopt( $ch, CURLOPT_HEADER,1 );

         $post_data = array("merId"=>$merid,"attach"=>time(),"merNo"=> $_GET['out_trade_no'], "title"=>'tradeplatformcharge', "describe"=> "tradeplatformcharge",
                "payType"=>$paytype,"price"=>$_GET['price'], "notifyUrl"=>C('WAP_DOMAIN').'/wap/wxpay/notify/', "synUrl"=>C('WAP_DOMAIN').'/wap/wxpay/synurl/',"sign"=>$sign);

         curl_setopt( $ch, CURLOPT_POST,1 );
         curl_setopt( $ch, CURLOPT_POSTFIELDS, $post_data);
         $output = curl_exec( $ch );
         curl_close( $ch );

         $str1 = strstr( $output, "GMT" );
         $str2 = substr( $str1, 4, strlen( $str1 ) );

         echo is_null( json_decode( $str2 ) );
         $test = json_decode( $str2 );
         $orderUrl = urldecode( $test->data->orderUrl );
//         echo $orderUrl;
         @header("Location:$orderUrl");
    }



	//支付发启页面 （原版的，已经废弃）
	public function indexold(){

		$tjurl = "http://zf.cnzypay.com/Pay_Index.html";   //提交地址
		//$module="CNZYZF";
		$this->token = I('get.token','','trim');
		empty($this->token) && exit("<h2>参数错误：token不能为空！</h2>");
		$this->wechat_id = I('get.wechat_id','','trim');
		//支付场景模块
		$module = I('get.module',WXPAY::MODULE_SHOP,'intval');
		$out_trade_no = I('get.out_trade_no','','trim');
		//获取订单详细信息
		$order = $this->getOrderDetail($this->token,$out_trade_no,$module);
		$this->wechat_id = I('get.wechat_id','','trim');
		Log::write("__wechat_id".$this->wechat_id,'wchart_INFO');
		//$Md5key="RVEDFulA9lzKjppaQfC5nqQpVtM8PD";    //商户密钥
		$Md5key="yOQr8xiuyGF1Vpxz2poqRsqTeYp8pY";    //商户密钥
		$pay_memberid = "11834";    //商户ID
		//$pay_memberid = $pay_memberid;
		$pay_orderid = $out_trade_no;    //订单号 $data['ordersn']
		$pay_amount = $order['total_fee'];

		$pay_applydate = date("Y-m-d H:i:s");
		$pay_bankcode = "WXZF";   //银行编码
		//$pay_notifyurl = C('WAP_DOMAIN').'/wap/wxpay/notify/';//."&code=".$payment['code'];
		//$pay_notifyurl = 'http://ceshi.snxweb.com/wap/wxpay/notify';//."&code=".$payment['code'];
		
		
		$pay_notifyurl='http://10.kuhusoft.cn/wap/wxpay/notify/token/'.$this->token.'.html';
		
		//$pay_callbackurl =I('get.callback',C('WAP_DOMAIN').U('Wxpay/paySuccess'),'urldecode');
		
		
		$pay_callbackurl ='http://10.kuhusoft.cn'.U('Wxpay/paySuccess');
		
		
		$requestarray = array(
				"pay_memberid" => $pay_memberid,
				"pay_orderid" => $pay_orderid,
				"pay_amount" => $pay_amount,
				"pay_applydate" => $pay_applydate,
				"pay_bankcode" => $pay_bankcode,
				"pay_notifyurl" => $pay_notifyurl,
				"pay_callbackurl" => $pay_callbackurl
		);
			
			
		ksort($requestarray);
		reset($requestarray);
		$md5str = "";
		foreach ($requestarray as $key => $val) {
			$md5str = $md5str . $key . "=>" . $val . "&";
		}
		//echo($md5str . "key=" . $Md5key."<br>");
		$sign = strtoupper(md5($md5str . "key=" . $Md5key));
		$requestarray["pay_md5sign"] = $sign;

		$requestarray["tongdao"] = "WftWx";   //公众号支付通道
		
		//当前操作者的微信id 唯一标示符号
		$requestarray["pay_reserved1"] = $this->wechat_id;
		
		$requestarray["pay_reserved3"] = $this->wechat_id;
		
		
		//$def_url  = '<br /><form style="text-align:center;" method="post" action="'.$this->gateway.' "target="_blank">';
		
		$def_url  = '<br /><form id="Form1" style="text-align:center;" method="post" action="'.$tjurl.'" target="_blank">';
		
		
		foreach ($requestarray as $key => $val) {
			$def_url = $def_url . '<input type="hidden" name="' . $key . '" value="' . $val . '" />';
		}
		$def_url .= '<input type="submit" value="继续支付,充值不到账联系客服微信：weijiaoyizhuli" />';
		$def_url .= '</form>';
		//$def_url .= ' document.Form1.submit()';
	
		//$this->assign("PayPackage",$requestarray);
		$this->assign('callback',$def_url);
		$this->assign('order',$order);
		$this->display('index');
		
	}

	public function test(){
	    $string = "HTTP/1.1 302 Found Date: Fri, 18 Aug 2017 02:49:20 GMT Server: Apache X-Powered-By: PHP/5.3.3 Location: http://www.lefusdk.com/desktop/wpay-wap_app.php?request_redis_id=170818104920364B0L3RR8V Content-Length: 0 Connection: close Content-Type: text/html; charset=UTF-8";
	    $string1 =  strstr( $string, "http://" );
	    $string2 =  strpos( $string1, " Content-Length:" );
	    echo substr( $string1, 0, $string2 );
	}

	/*lefu*/
	public function notify(){
        $xml = file_get_contents("php://input");
        file_put_contents("notifypsot.txt","\r\n",FILE_APPEND);
        file_put_contents("notifypsot.txt",$xml,FILE_APPEND);

        $inputdata = json_decode( $xml );

        $secretkey = "10366036frc6";
	    $data['appid'] = $inputdata->appid;
	    $data['cp_trade_no'] = $inputdata->cp_trade_no;
	    $data['cpid'] = $inputdata->cpid;
	    $data['fee'] = $inputdata->fee;
	    $data['pay_transaction_id'] = $inputdata->pay_transaction_id;
	    $data['result_code'] = $inputdata->result_code;
	    $data['user_id'] = $inputdata->user_id;
        ksort( $data );
        $stringA = "";
        foreach( $data as $key=>$value )
        {
            if( $value != null || $value != "" )
            $stringA = $stringA.$key."=".urlencode($value)."&";
        }
        $stringA = $stringA."key=".$secretkey;
        $stringA = $stringA.strtoupper();
        $sign =md5($stringA);

        file_put_contents("notifypsot.txt",$inputdata->sign,FILE_APPEND);
        file_put_contents("notifypsot.txt",$data['cp_trade_no'],FILE_APPEND);

        if( strtoupper($sign) == $inputdata->sign  )
        {
            $order = M('juejin_payorder')->where(array('ordersn'=>$data['cp_trade_no']))->select();
            if( count( $order ) == 1 )
            {
                if($order['status'] != 2){
                    M('juejin_payorder')->where(array('ordersn'=>$data['cp_trade_no']))->save(['status'=>2,'paytime'=>time()]);
                    M('juejin_users')->where(['id'=>$data['user_id']])->setInc('money',$data['fee']/100);
                    M('juejin_users')->where(['id'=>$data['user_id']])->setInc('addmoney',$data['fee']/100);

                    echo "success";
                }else{
                    echo "already pay";
                }
            }else{
                echo "trnorepeat";
            }
        }else{
            echo "sign error";
        }
	}


	public function notifyqmjf()
	{
        $xml = file_get_contents("php://input");
        file_put_contents("notifyqmjfpsot.txt","\r\n",FILE_APPEND);
        file_put_contents("notifyqmjfpsot.txt","input".$xml,FILE_APPEND);
        file_put_contents("notifyqmjfpsot.txt","\r\n",FILE_APPEND);
        file_put_contents( "notifyqmjfpsot.txt", "post", I("post.") );
        file_put_contents("notifyqmjfpsot.txt","\r\n",FILE_APPEND);
        file_put_contents( "notifyqmjfpsot.txt", "get", I("get.") );
	}


	/*lefu*/
	public function jump(){
	    $url = $_SERVER['SERVER_NAME'];
        $url = "http://".$url;
        @header("Location:$url");
        exit();
	}


	public function notifyOld(){
		/*
		$this->token = I('get.token','','trim')
		$xml = file_get_contents("php://input");
		Log::write("[WXPAY]:xml=".$xml,'DEBUG');
		
		Vendor("WxPayV3.WxPayPubHelper");
		//使用通用通知接口
		$notify = new \Notify_pub();
		$config = $this->getConfig($this->token);
		$notify->KEY = $config['KEY'];
		//存储微信的回调
		$xml = $GLOBALS['HTTP_RAW_POST_DATA'];
		$notify->saveData($xml);
		
		

		$ReturnArray = array( // 返回字段
				"memberid" => $_REQUEST["memberid"], // 商户ID
				"orderid" =>  $_REQUEST["orderid"], // 订单号
				"amount" =>  $_REQUEST["amount"], // 交易金额
				"datetime" =>  $_REQUEST["datetime"], // 交易时间
				"returncode" => $_REQUEST["returncode"]
		);
		
		$Md5key = "yOQr8xiuyGF1Vpxz2poqRsqTeYp8pY";    //就是这里,验证回调的商户密钥
		//$sign = $this->md5sign($Md5key, $ReturnArray);
		
		///////////////////////////////////////////////////////
		ksort($ReturnArray);
		reset($ReturnArray);
		$md5str = "";
		foreach ($ReturnArray as $key => $val) {
			$md5str = $md5str . $key . "=>" . $val . "&";
		}
		$sign = strtoupper(md5($md5str . "key=" . $Md5key));
		///////////////////////////////////////////////////////
		if ($sign == $_REQUEST["sign"]) {
			if ($_REQUEST["returncode"] == "00") {
				$str = "交易成功！订单号：".$_REQUEST["orderid"];
				//设置订单号 和  wechat_id
				$notify->data['out_trade_no']=$_REQUEST["orderid"];
				//$this->wechat_id = I('get.wechat_id','','trim');
				//修改openid  也就是 wecahrtid
				$notify->data['openid']=$_REQUEST["reserved1"];
				//更新订单状态
				$this->ZyZfupdateOrderState($notify->data);
				echo OK;
			}
		}*/
	}


    /*98支付*/
	public function nnpay(){
        $array['merchant_no'] = "2016169558218894";
        $array['amount'] = "0.1";
        $array['user_order_no'] = "20161024090807";//test tmp
        $array['sett_currency_type'] = 'CNY';
        $array['currency_type'] = 'CNY';
        $array['return_url'] = C('WAP_DOMAIN').'/wap/wxpay/synurl';
        $array['product_name'] = "wxtradeplatform";
	}


	public function synurl(){
	    echo "这里是商户";
	}
	
	/**@desc 更新订单状态
	 * @param array data: out_trade_no,openid
	 */
	protected function ZyZfupdateOrderState($data){
		
		//支付业务
//		 $order = M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no'],'wechat_id'=>$data['openid']))->find();
		 $order = M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no']))->find();
		if($order['status'] != 2){
			M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no'],'wechat_id'=>$data['openid']))->save(['status'=>2,'paytime'=>time()]);
			M('juejin_users')->where(['id'=>$order['userid']])->setInc('money',$order['price']);
				
			M('juejin_users')->where(['id'=>$order['userid']])->setInc('addmoney',$order['price']);
		}

	
	/*	//if($order['price']>=100){
			
			//M('juejin_users')->where(['id'=>$order['userid']])->setInc('money',$order['price']);   //这行是累加反利金额的,条件是大于100 注释掉就不返利
		//}

		 */

	
/*
	
		$order = M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no']))->find();
		M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no']))->save(['status'=>2,'paytime'=>time()]);
		M('juejin_users')->where(['id'=>$order['userid']])->setInc('money',$order['price']);
			
		M('juejin_users')->where(['id'=>$order['userid']])->setInc('addmoney',$order['price']);
			
		if($order['price']>=0){
			M('juejin_users')->where(['id'=>$order['userid']])->setInc('money',$order['price']);
		}


		 */

		
		
		/*$user = M('juejin_users')->where(['id'=>$order['userid']])->find();*/
		 	
		 	 	
		/* if($user['shareid']){//上级返利
		 $fanli = $order['price']*0.1;
		 M('juejin_users')->where(['id'=>$user['shareid']])->setInc('money',$fanli);
		 //添加返利记录表
		 M('juejin_fanliorder')->add(['userid'=>$order['userid'],'wechat_id'=>$data['openid'],'touserid'=>$user['shareid'],
		 'price'=>$fanli,'status'=>2,'createtime'=>time()]);
		
		 } */
		
	}
	
	/**
	 *@method getOrderDetail
	 *@desc 通过订单号获取支付详情
	 *@param string token
	 *@param string orderId
	 *@param int module 
	 */
	protected function getOrderDetail($token,$orderId,$module){
		$ret = array();
		switch($module){
			case WXPAY::MODULE_SHOP:
				$order = M('juejin_payorder')->where(array('ordersn'=>$orderId))->find();
				$ret['total_fee'] = $order['price'];//0.1;
				if($_SESSION['user_id']==27){$ret['total_fee'] = 0.1;}//0.1;}
				$ret['body'] = '会员充值';
				return $ret;
			case "CNZYZF":
				
				$order = M('juejin_payorder')->where(array('ordersn'=>$orderId))->find();
				$ret['total_fee'] = 0.01;//0.1;
				
				//$ret['total_fee'] = $order['price'];//0.1;
				
				if($_SESSION['user_id']==27){$ret['total_fee'] = 0.1;}//0.1;}
				$ret['body'] = '会员充值';
				return $ret;
				
		}
		return null;
	}
	
	/**@desc 更新订单状态
	 * @param array data: out_trade_no,openid
	 */
	protected function updateOrderState($data,$token){
		$module = intval($data['attach']);
		if($module == WXPAY::MODULE_SHOP){
			//支付业务
			$order = M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no'],'wechat_id'=>$data['openid']))->find();
			M('juejin_payorder')->where(array('ordersn'=>$data['out_trade_no'],'wechat_id'=>$data['openid']))->save(['status'=>2,'paytime'=>time()]);
			M('juejin_users')->where(['id'=>$order['userid']])->setInc('money',$order['price']);
			
			M('juejin_users')->where(['id'=>$order['userid']])->setInc('addmoney',$order['price']);
			
	/*	//	if($order['price']>=0){
		//		M('juejin_users')->where(['id'=>$order['userid']])->setInc('money',$order['price']);
		//	}
			$user = M('juejin_users')->where(['id'=>$order['userid']])->find();*/
			
			
			/* if($user['shareid']){//上级返利
				$fanli = $order['price']*0.1;
				M('juejin_users')->where(['id'=>$user['shareid']])->setInc('money',$fanli);
				//添加返利记录表
				M('juejin_fanliorder')->add(['userid'=>$order['userid'],'wechat_id'=>$data['openid'],'touserid'=>$user['shareid'],
				'price'=>$fanli,'status'=>2,'createtime'=>time()]);
				
			} */
			
		}
		
	}
	
	//保存通知记录,如果已经存在则返回false
	public function checkNotify($token,$notify){
		$data['transaction_id'] = $notify['transaction_id'];
		$data['out_trade_no'] = $notify['out_trade_no'];
		$data['openid'] = $notify['openid'];
		$data['time_end'] = $notify['time_end'];
		$data['total_fee'] = floatval($notify['total_fee'])/100;
		$data['bank_type'] = $notify['bank_type'];
		$data['module'] = $notify['attach'];
		$data['trade_type'] = $notify['trade_type'];
		$data['is_subscribe'] = $notify['is_subscribe'];
		$data['token'] = $token;
		$check = M('wxpay_notify')->where(['transaction_id'=>$notify['transaction_id']])->count();
		if($check==0){
			M('wxpay_notify')->add($data);
		}
		return true;
	}
	//原生支付通知接口
	public function native(){
	
	}
	
	//支付成功跳转页面
	public function paySuccess(){
		$this->assign('order_id',$_GET['oid']);
		$this->display('paysuccess');
	}
	
	//支付失败跳转页面
	public function payError(){
		
	}
	
	//用户维权接口
	public function rights(){
		$xml = get_http_body();
		$content = xml2array($xml);
		$data['openid'] = $content['OpenId'];
		$data['msg_type'] = $content['MsgType'];
		$data['feed_back_id'] = $content['FeedBackId'];
		$data['trans_id'] = $content['TransId'];
		$data['reason'] = $content['Reason'];
		$data['solution'] = $content['Solution'];
		$data['extinfo'] = $content['ExtInfo'];
		$data['time'] = $content['TimeStamp'];
		
		M('customer_rights')->add($data);
	}
	
	//系统告警
	public function alarm(){
		$xml = get_http_body();
		$alarm = xml2array($xml);
		$data['error_type'] = $alarm['ErrorType'];
		$data['desc'] = $alarm['Description'];
		$data['content'] = $alarm['AlarmContent'];
		$data['time'] = $alarm['TimeStamp'];
		
		M('alarm')->add($data);
		echo 'success';
	}
	
	//微信发货通知
	public function fahuo(){
		$oid = I('get.oid','','trim');
		$pay = new \Wap\Logic\Wxpay($this->token);
		$this->ajaxReturn($pay->delivernotify($oid));
	}
	/*
	<xml>
		<OpenId><![CDATA[o0pk9uIVnlY-fJkzFKEbQ6LJ4cFc]]></OpenId>
		<AppId><![CDATA[wxc04ce1d87dcd13cd]]></AppId>
		<TimeStamp>1401206434</TimeStamp>
		<MsgType><![CDATA[request]]></MsgType>
		<FeedBackId>13275936403980775178</FeedBackId>
		<TransId><![CDATA[1218614901201405273313470595]]></TransId>
		<Reason><![CDATA[没有收到货品]]></Reason>
		<Solution><![CDATA[退款，并不退货]]></Solution>
		<ExtInfo><![CDATA[Test 13456780012]]></ExtInfo>
		<AppSignature><![CDATA[1f4a626f59f9ae8007158b0a9510e88db56fa80b]]></AppSignature>
		<SignMethod><![CDATA[sha1]]></SignMethod>
	</xml>
	<xml>
		<OpenId><![CDATA[111222]]></OpenId>
		<AppId><![CDATA[wwwwb4f85f3a797777]]></AppId>
		<TimeStamp>1369743511</TimeStamp>
		<MsgType><![CDATA[confirm/reject]]></MsgType>
		<FeedBackId><![CDATA[5883726847655944563]]></FeedBackId>
		<Reason><![CDATA[商品质量有问题]]></Reason>
		<AppSignature><![CDATA[bafe07f060f22dcda0bfdb4b5ff756f973aecffa]]></AppSignature>
		<SignMethod><![CDATA[sha1]]></SignMethod>
	</xml>
	*/
	/*告警POST
	<xml>
		<AppId><![CDATA[wxf8b4f85f3a794e77]]></AppId>
		<ErrorType>1001</ErrorType>
		<Description><![CDATA[错识描述]]></Description>
		<AlarmContent><![CDATA[错误详情]]></AlarmContent>
		<TimeStamp>1393860740</TimeStamp>
		<AppSignature><![CDATA[f8164781a303f4d5a944a2dfc68411a8c7e4fbea]]></AppSignature>
		<SignMethod><![CDATA[sha1]]></SignMethod>
	</xml>
	*/
}
?>